Getting started
To start working with Yandex Taxi:
-
Get a token for sending API requests:
-
Log in to your Yandex Taxi Corporate Client Dashboard with the mail to which is attached your Yandex Go for business account.
-
Go to the Company profile section.
-
Click Get token.
-
At oauth.yandex.ru, click Enter as "your login". You will be redirected to the Yandex Taxi Corporate Client Dashboard.
-
You can find your OAuth token under Access token generated.
-
-
API tokens are valid for a limited time and then expire. Use the Update OAuth token request to get the lifetime of your token.
-
If the token lifespan is about to expire, run the Update OAuth token request again. This renews the token expiration date and you can continue using your current token.
-
If the token expires, get a new token in the Yandex Taxi Corporate Client Dashboard.
Note
If the token is lost, contact Yandex ID to reissue it.
-
-
Use the OAuth token in all API requests. Pass the token in the header:
-
In the API version 1.0:
Authorization: <token value>. -
In the API version 2.0:
Authorization: Bearer <token value>.
Note
To work with the API 1.0, use the host
https://business.taxi.yandex.ru, and to work with the API 2.0, use the hosthttp://b2b-api.go.yandex.ru. -
-
If one Yandex ID account has an access to several personal accounts, you have to specify the
X-YaTaxi-Selected-Corp-Client-Idheader for all requests as follows:-
In the personal account go to the Company profile tab.
-
Transfer the client's ID to the header.
-
-
Create user roles.
-
Add user accounts:
-
In the API version 1.0: Create a user.
-
In the API version 2.0: Create a user.
-
Ordering a ride
After you receive the token and add information about your users, you can use the Yandex Taxi API to order rides.
The ordering procedure is as follows:
-
Learn the price and conditions of your upcoming ride and get an offer.
-
Create a draft order.
-
Pass the order for processing.
-
If necessary, cancel the order.